import { info } from "./url"

async function login(code) {
  return uni.request({
    url: `${info.url}/security/login`,
    data: { code },
    method: "POST"
  });
}

async function mLogin(code) {
  return uni.request(`${info.url}/security/m_login`, { code }, "POST");
}

async function setAdmin(id) {
  return uni.request(`${info.url}/security/admin`, { id }, "PUT");
}

export default { login, mLogin, setAdmin };